﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<WebClient.Models.ViewModels.GroupViewModel>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
    <script type="text/javascript">
        function onSelectedIndexChanged_City() {
            var city = document.getElementsByName("ListCity").item(0);
            window.location.href = "../Home/SelectDistricts?idcity=" + city.value;
        }
        function onSelectedIndexChanged_District() {
            var district = document.getElementsByName("ListDistrict").item(0);
            // if foodtype is have selected value
            var foodtype = document.getElementsByName("ListFoodType").item(0);
            if (foodtype.value != "0" && district.value != "0") {
                window.location.href = "../Home/SelectRestaurants?iddistrict=" + district.value + "&idfoodtype=" + foodtype.value;
            }
        }
        function onSelectedIndexChanged_FoodType() {
            var foodtype = document.getElementsByName("ListFoodType").item(0);
            // if district is have selected value
            var district = document.getElementsByName("ListDistrict").item(0);
            if (district.value != "0" && foodtype.value != "0") {
                window.location.href = "../Home/SelectRestaurants?iddistrict=" + district.value + "&idfoodtype=" + foodtype.value;
            }
        }
    </script>
    <div id="content">
        <div id="container">
            <% using (Html.BeginForm("SelectRestaurant", "Home", FormMethod.Post, new { enctype = "multipart/form-data", onsubmit = "return ValidateNhaDat();" }))
            { %>
            <div id="div6">
                <div id="bg">
                    <div style="z-index: 0; position: absolute;">
                        <img  src="http://www.vietnammm.com/bg/1.jpg">
                        <img  src="http://www.vietnammm.com/bg/2.jpg" style="z-index: 0; opacity: -0.001;">
                        <img  src="http://www.vietnammm.com/bg/3.jpg" style="z-index: 0; opacity: -0.001;">
                        <img  src="http://www.vietnammm.com/bg/4.jpg" style="z-index: 0; opacity: -0.001;">
                    </div>
                </div>
                <div id="div77" style="z-index: 2; position: absolute;">
                    <div id="div7t"></div>
                    <div id="div777">
                        <div style="margin-bottom: 5px;">
                            <h1 style="font-size: 24px; font-family: Arial, Helvetica, sans-serif; color: #FF0000; font-weight: bold;">
		                        Order food        
                            </h1>
                        </div>
                            If you're looking for the best delivery restaurants in Vietnam, you're at the right place! <font color="#FF0000"><b><%= WebConfiguration.SiteName %></b></font> has an extensive list of the top delivery restaurants near you. Order Pizza, Sushi, Vietnamese or anything you like right from your screen!<br />
                        <div style="margin-top: 10px; height: 138px;">
                            <b>Select your city below:</b>
                            <div style="float: left;">
                                <%
                                    var items = new List<SelectListItem>();
                                    // Add first item : select your city
                                    items.Add(new SelectListItem
                                    {
                                        Text = "Select your city",
                                        Value = "0"
                                    });
                                    // Select next city
                                    foreach (var item in Model.AllCityModel.GetModel.LstObjModel)
                                    {
                                        items.Add(new SelectListItem
                                        {
                                            Text = item.Name,
                                            Value = item.ID.ToString()
                                        });
                                    } 
                                %>
                                <%= Html.DropDownList("ListCity", new SelectList(items, "Value", "Text", Model.DistrictModelByCity.ReferKeys.IDCity.ToString()), new { @id = "cityfp", onChange = "onSelectedIndexChanged_City()" })%>
                            </div>
                            <div style="clear: both; padding-top: 5px;"></div>
                            <div id="selectfp" style="float: left;">
                                <%
                                    items = new List<SelectListItem>();
                                    // Add first item : select your city
                                    items.Add(new SelectListItem
                                    {
                                        Text = "Select your district",
                                        Value = "0"
                                    });
                                    // Select next city
                                    foreach (var item in Model.DistrictModelByCity.GetModel.LstObjModel)
                                    {
                                        items.Add(new SelectListItem
                                        {
                                            Text = item.Name,
                                            Value = item.ID.ToString()
                                        });
                                    } 
                                %>
                                <%= Html.DropDownList("ListDistrict", new SelectList(items, "Value", "Text"), new { @id = "districtfp", onChange = "onSelectedIndexChanged_District()" })%>
                            </div>
                            <div style="clear: both; padding-top: 5px;"></div>
                            <div id="selectcufp" style="float: left;">
                                <%
                                    items = new List<SelectListItem>();
                                    // Add first item : select your city
                                    items.Add(new SelectListItem
                                    {
                                        Text = "Pick your food",
                                        Value = "0"
                                    });
                                    // Select next city
                                    foreach (var item in Model.FoodTypeModel.GetModel.LstObjModel)
                                    {
                                        items.Add(new SelectListItem
                                        {
                                            Text = item.Name,
                                            Value = item.ID.ToString()
                                        });
                                    } 
                                %>
                                <%= Html.DropDownList("ListFoodType", new SelectList(items, "Value", "Text"), new { @id = "cuisListfp", onChange = "onSelectedIndexChanged_FoodType()" })%>
                            </div>
                        </div>
                    </div>
                    <div id="div7b"></div>
                </div>
            </div>
            <% } %>
        </div>
    </div>
</asp:Content>
